﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Data.Entity;
//using System.Web;
//using System.ServiceModel.DomainServices.Hosting;
//using System.ServiceModel.DomainServices.EntityFramework;

//namespace GlobalOfficeTools.Web.RIA.ClientsContext
//{
//    [EnableClientAccess]
//    public partial class ClientsService : DbDomainService<GlobalOfficeToolsContext>
//    {
//        #region CRUD Methods 
//        #region CLItblUser 
//        public IQueryable<CLItblUser> GetUsers() 
//        {
//            return this.DbContext.CLItblUsers;
//        }
//        #endregion
//        #endregion

//        #region Custom Methods 
//        public IQueryable<CLItblUser> GetUser(string userName, string password, string federationType) 
//        {
//            // TODO: this need a little more logic
//            var federationDetail = (from x in this.DbContext.CLItblFederationDetails
//                                    where x.UserName == userName
//                                    select x).FirstOrDefault();

//            if (federationDetail == null) return null;
//            else return (from x in this.DbContext.CLItblUsers.Include("CLItblUserOption")
//                         where x.UserId == federationDetail.UserId
//                         select x);
//        }
//        public IQueryable<CLItblCompany> GetCompany(int companyId) 
//        {
//            return from x in this.DbContext.CLItblCompanies.Include("CLItblCompanyOption")
//                   where x.CompanyId == companyId
//                   select x;
//        }

//        public IQueryable<CLIvwClientType> ListClientTypes(int companyId) 
//        {
//            return from x in this.DbContext.CLIvwClientTypes
//                   where x.CompanyId == companyId
//                   orderby x.Value
//                   select x;
//        }
//        public IQueryable<CLIvwVendorType> ListVendorTypes(int companyId) 
//        {
//            return from x in this.DbContext.CLIvwVendorTypes
//                   where x.CompanyId == companyId
//                   orderby x.Value
//                   select x;
//        }
//        public IQueryable<CLIvwUserGroup> ListUserGroups(int companyId) 
//        {
//            return from x in this.DbContext.CLIvwUserGroups
//                   where x.CompanyId == companyId
//                   orderby x.Value
//                   select x;
//        }
//        public IQueryable<CLIvwEmployee> ListEmployees(int companyId)
//        {
//            return from x in this.DbContext.CLIvwEmployees
//                   where x.CompanyId == companyId
//                   orderby x.FullName
//                   select x;
//        }
//        #endregion
//    }
//}